package com.yeshine.opendata.utils;

import java.util.Set;


/*import org.artofsolving.jodconverter.OfficeDocumentConverter;
import org.artofsolving.jodconverter.office.DefaultOfficeManagerConfiguration;
import org.artofsolving.jodconverter.office.OfficeManager;*/

import java.io.File;
import java.util.HashSet;
import java.util.Set;

/**
 * Created by taohj on 2014/9/15.
 */
public class OfficeExtractor {


    public final static Set<String> sets = new HashSet<String>();

    static {
        sets.add(".doc");
        sets.add(".docx");
        sets.add(".xls");
        sets.add(".xlsx");
        sets.add(".ppt");
        sets.add(".pptx");
        sets.add(".csv");
    }


   /* public static OfficeManager officeManager;*/
    private static String OFFICE_HOME = "C:\\Program Files (x86)\\OpenOffice 4";
    private static int port[] = {8100};

    public void convert2PDF(String inputFile, String pdfFile) {

    }


    public static void startService() {

    }

    public static void stopService() {

    }


    public static void toHtml(String sourcefile, String htmlfile) {


     /*   if (!sets.contains(sourcefile.substring(sourcefile.lastIndexOf(".")))) {
            return;
        }

        File inputFile = new File(sourcefile);
        File outputFile = new File(htmlfile);
        startService();
        OfficeDocumentConverter converter = new OfficeDocumentConverter(officeManager);
        converter.convert(inputFile, outputFile);
        stopService();*/
    }



}
